package io.renren.modules.student.controller;


import io.renren.common.utils.R;
import io.renren.modules.gaokaobaobei.entity.UserBackupEntity;
import io.renren.modules.gaokaobaobei.service.UserBackupService;
import io.renren.modules.school.entity.UniversityEntity;
import io.renren.modules.student.service.StudentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    StudentService studentService;
    @Autowired
    UserBackupService userBackupService;

    @RequestMapping("/getStudentById")
    R getStudentById(Integer id){
        UserBackupEntity userBackupEntity=userBackupService.selectById(id);
        List<UniversityEntity> schools=studentService.getUniversityListByStudentId(id);
        return R.ok().put("student",userBackupEntity).put("schools",schools);
    }

}
